package com.han.hotelplat.service.clientversion.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.han.hotelplat.dao.clientversion.ClientversionDao;
import com.han.hotelplat.pojo.clientversion.ClientVersion;
import com.han.hotelplat.service.clientversion.ClientversionService;

@Service
public class ClientversionServiceImpl implements ClientversionService{
	@Autowired
	private ClientversionDao clientversionDao;

	@Override
	public ClientVersion getNowVersion(Integer type, Integer clientType) {
		String hql = "from ClientVersion where type = "+type +" and clienttype="+clientType;
		List<ClientVersion> re = clientversionDao.findByHQL(hql);
		for(ClientVersion c : re){
			if(c.getNowversion().intValue() == 1){//是当前最新版本
				return c;
			}
		}
		return null;
	}
	
}
